﻿using Microsoft.AspNetCore.Builder;
using MKAdminCore.ToolKit.Middleware;
using System;
using System.Collections.Generic;
using System.Text;

namespace MKAdminCore.ToolKit.Extensions
{
    /// <summary>
    /// 记录接口执行时间
    /// </summary>
    public static class RequestLoggerMiddlewareExtensions
    {
        public static IApplicationBuilder UseCalculateExecutionTime(this IApplicationBuilder app)
        {
            if (app == null)
            {
                throw new ArgumentNullException(nameof(app));
            }
            return app.UseMiddleware<RequestLoggerMiddleware>();
        }
    }
}
